import React, { Component } from 'react'
import { TopicWrapper, TopicItem } from './style'
import { connect } from 'react-redux'

class Topic extends Component {
  render() {
    let { list } = this.props
    return (
      <TopicWrapper>
        {list.map((item) => (
          <TopicItem key={item.get('id')}>
            <img className="topic-pic" alt="topic-pic" src={item.get('imgUrl')} />
            {item.get('title')}
          </TopicItem>
        ))}
      </TopicWrapper>
    )
  }
}
const mapStateToProps = (state) => {
  return {
    list: state.getIn(['home', 'topicList']),
  }
}
const mapDispatchToProps = {}
export default connect(mapStateToProps, mapDispatchToProps)(Topic)
